curve(sin(x),-2*pi,2*pi)
curve(tan(x),-2*pi,2*pi)

f <- function(x){
  if (x >= 0) {x}
  else {x^2}
}
x <- seq(-2,2,length=100)
y <- rep(0,length(x))
j <- 1
for (i in x){
  y[j] <- f(i)
  j <- j+1
}
plot(x,y,type='l')

v <- c(7,12,28,3,41)
png(file='chart.png')
plot(v,type='o',col='red',
     xlab='Month',ylab='Rain fall',
     main='Rain fall chart')
dev.off()
